<% layout("/WEB-INF/view/console/skins/skin_2/layout_nonav.html", {}) {
%>
<h2 class="header-text"  style="padding-top: 60px;">
    商城系统
						<span class="sub-header">
						发货
						</span>
</h2>
<div class="row">
    <div class="col-md-12 column">
        <div class="row clearfix">
            <div class="col-md-3 column">
            </div>

            <div class="col-md-6 column">
                <form role="form" id="form" class="form-horizontal">

                    <div class="form-group clearfix">
                        <label class="col-xs-2 text-right">订单编号</label>
                        <div class="col-sm-4">
                            <span >${orderInfo.orderNumber!}</span>
                        </div>
                    </div>
                    <div class="form-group clearfix">
                        <label class="col-xs-2 text-right">金额</label>
                        <div class="col-sm-4">
                            <span class="label label-danger" >${orderInfo.orderPrice}</span>
                        </div>
                    </div>
                    <script type="text/javascript">
                        $(function($){
                            $('input[auto_name="boProxyOrder_takeTheir"]').each(function(){
                                if('${boProxyOrder.takeTheir!}'==this.value){
                                    $(this).attr('checked','checked');
                                }
                            });
                            $('input[auto_name="boProxyOrder_takeTheir"]').on("change",function(){
                               if($('input[auto_name="boProxyOrder_takeTheir"]').eq(0).is(":checked")){
                                           $("#shippingInfoId").hide(1000);
                               }else{
                                   $("#shippingInfoId").show(1000);
                               }
                            });
                        });
                    </script>

                    <div id="shippingInfoId">
                    <div class="form-group clearfix">
                        <label class="col-xs-2 text-right">收货人</label>
                        <div class="col-sm-4">
                            <span id="s_consigneeName">${shippingAddress.consignee!}</span>
                        </div>
                    </div>
                    <div class="form-group clearfix">
                        <label class="col-xs-2 text-right">收货人电话</label>
                        <div class="col-sm-4">
                            <span id="s_consigneePhone">${shippingAddress.phone!}</span>
                        </div>
                    </div>
                    <div class="form-group clearfix">
                        <label class="col-xs-2 text-right">邮编</label>
                        <div class="col-sm-4">
                            <span id="s_shippingPostcode">${shippingAddress.postCode!}</span>
                        </div>
                    </div>
                    <div class="form-group clearfix">
                        <label class="col-xs-2 text-right">收货人地址</label>
                        <div class="col-sm-4">
                            <span id="s_shippingProvince">${shippingAddress.province!}</span>
                            <span id="s_shippingCity">${shippingAddress.city!}</span>
                            <span id="s_shippingCounty">${shippingAddress.county!}</span>
                        </div>
                    </div>
                    <div class="form-group clearfix">
                        <label class="col-xs-2 text-right">收货人详细地址</label>
                        <div class="col-sm-4">
                            <textarea class="form-control" disabled="disabled" id="s_shippingDetailAddress">${shippingAddress.address!}</textarea>
                        </div>
                    </div>
                    <div class="form-group clearfix">
                        <label class="col-xs-2 text-right">快递公司</label>
                        <div class="col-sm-4">
                            <input  type="text"  name="expressCompany" id="expressCompany" class="form-control" check-type="required" value='' >
                        </div>
                    </div>
                    <div class="form-group clearfix">
                        <label class="col-xs-2 text-right">快递单号</label>
                        <div class="col-sm-4">
                            <input  type="text"  name="expressNumber" id="expressNumber" class="form-control" check-type="required" value='' >
                        </div>
                    </div></div>
                    <div class="form-group clearfix">
                        <label class="col-xs-2 text-right">其他</label>
                        <div class="col-sm-4">
                            <input  type="text"  name="expressRemark" id="expressRemark" class="form-control" check-type="required" value='' >
                        </div>
                    </div>
                    <input type='hidden' name='order_token' id='order_token' value='${order_token!}'>
                </form>
            </div>
    </div>
        </div>
    <div class="col-md-12">
        <div class="row">
            <div class="col-md-3 column">
            </div>
            <div class="col-md-6">
                <table class="table">
                    <thead>
                    <tr>
                        <th>商品名称</th>
                        <th>商品价格</th>
                        <th>商品图片</th>
                        <th>购买数量</th>
                    </tr>
                    </thead>
                    <tbody>
                    <% for (goodsInfo in orderGoodses){%>
                    <tr>
                        <td>${goodsInfo.orderGoodsTitle!}</td>
                        <td>${goodsInfo.orderGoodsPrice!}</td>
                        <td><img  style="width: 100px;" src="${ctxPath}${goodsInfo.orderGoodsImage!}"/></td>
                        <td>${goodsInfo.orderGoodsNumber!}</td>
                    </tr>
                    <% }%>
                    </tbody>
                </table>
            </div>
    </div>
        </div>
    </div>

</div>
<nav class="navbar navbar-default navbar-fixed-bottom site-navbar" >
    <div class="container" style="padding-top:10px;padding-bottom:10px;">
        <div class="nav" >
            <a href="#" id="canlId"  class="label label-info" style="font-size: 24px;" >发货 </a>
        </div>
    </div>
</nav>

<script>
    $(function($){

        $("#canlId").click(function(){
            var takeTheir=($('input[name="takeTheir"]:checked').val()==''?null:$('input[name="takeTheir"]:checked').val());
           $.post("${ctxPath}/console/bo_proxy_order/fenxiao/shipments/do/${id}",{order_token:"${order_token!}",expressRemark:$("#expressRemark").val(),expressNumber:$("#expressNumber").val(),expressCompany:$("#expressCompany").val()},function(data){
               if(data.http_status=="1"){
                   alert("发货成功");
                   window.open("${ctxPath}/console/bo_proxy_order/list/fenxiao");
               }else{
                   alert(data.message);
                   window.open("${ctxPath}/console/bo_proxy_order/list/fenxiao");
               }
           });
       });

    });

</script>
<%} %>
